package com.shujia.wyh.day23;

import java.io.File;

/*
        判断功能
            public boolean isDirectory()
            public boolean isFile()
            public boolean exists()
            public boolean canRead()
            public boolean canWrite()
            public boolean isHidden()

 */
public class FileDemo5 {
    public static void main(String[] args) {
        File file = new File("D:\\冯提莫.jpg");

        //public boolean isDirectory() 判断目标是否是一个文件夹
        boolean b = file.isDirectory();
        System.out.println(b);

        //public boolean isFile() 判断目标是否是一个文件
        boolean b1 = file.isFile();
        System.out.println(b1);

        //public boolean exists() 判断目标文件或者文件夹是否存在
        boolean b2 = file.exists();
        System.out.println(b2);

        //public boolean canRead() 判断目标文件或者文件夹是否可读
        boolean b3 = file.canRead();
        System.out.println(b3);

        //public boolean canWrite() 判断目标文件或者文件夹是否可写
        boolean b4 = file.canWrite();
        System.out.println(b4);

        //public boolean isHidden() 判断目标文件或者文件夹是否隐藏
        boolean b5 = file.isHidden();
        System.out.println(b5);


    }
}
